﻿Public Class PhotoList
    Inherits ItemListPage

    Protected Overrides ReadOnly Property DefaultOrder() As OrderCriterion
        Get
            Return New OrderCriterion("CreatedDateTime", OrderCriterion.SortDirection.DESC)
        End Get
    End Property

    Protected Overrides ReadOnly Property DefaultFilter() As FilterCriterion
        Get
            Dim username As String = Request.QueryString.Get("UserName")
            If Not String.IsNullOrWhiteSpace(username) Then
                Return New FilterCriterion("MemberUserName", username)
            Else
                Return New FilterCriterion("Title", "")
            End If
        End Get
    End Property

    Protected Overrides ReadOnly Property CreatePageURL As String
        Get
            Return "~/Pages/PhotoDetail.aspx?Action=Add"
        End Get
    End Property

    Protected Overrides Function CreateDataGateway() As DataGateway
        Return New PhotoGateway()
    End Function

End Class